import axios from "../../axios.js"
// 客户管理接口
export default {
    // 获取所有客户
    getCustAllApi(data, binding) {
        return axios({
            url: '/crm/findAllCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 用id查询客户
    getCustByIdApi(data, binding) {
        return axios({
            url: '/crm/findByIdCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 用tle1查询客户
    getCustByTelApi(data, binding) {
        return axios({
            url: '/crm/findByTelCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //分配客户没有列表页
    // 删除分配客户
    deleteAllocatedApi(data, binding) {
        return axios({
            url: '/crm/toAllocated/deleteAllocated',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 获取待分配客户列表
    getCustCustomersListApi(data, binding) {
        return axios({
            url: '/crm/findAllocated',
            method: 'post',
            data,
            headers: {
                "binding": binding,
            },
        })
    },
    // 获取下属人员信息不带中心
    chooseMangerApi(data) {
        return axios({
            url: '/crm/selectLowDepartManager',
            method: 'get',
            params: data
        })
    },
    // 获取下属人员信息：带中心
    chooseMangerApi2(data, binding) {
        return axios({
            url: '/crm/selectDepartManager',
            method: 'get',
            params: data,
            headers: {
                "binding": binding,
            }
        })
    },
    // 批量分配客户数据
    bachDistributionApi(data, binding) {
        return axios({
            url: '/crm/bachDistribution',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 随机分配
    randomAllocationApi(data) {
        return axios({
            url: `/crm/random`,
            method: 'post',
            data
        })
    },
    //获取所有未读客户
    getAllUnreadApi(data, binding) {
        return axios({
            url: `/crm/unread`,
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //获取所有签单客户
    getAllSignApi(data, binding) {
        return axios({
            url: '/crm/findSignAll',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //新建签单
    createSignApi(data, binding) {
        return axios({
            url: '/crm/insertCustomerSign',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 是否关注
    isFocusApi(data, binding) {
        return axios({
            url: '/crm/isStatus',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 是否意向
    isInterestApi(data, binding) {
        return axios({
            url: '/crm/intention',
            method: 'post',
            data
        })
    },
    // 新建计划
    createPlanApi(data, binding) {
        return axios({
            url: '/crm/createCustomerPlan',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 获取特别关注客户
    focusCustApi(data, binding) {
        return axios({
            url: '/crm/findFlower',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 获取未接通客户
    findConnectApi(data, binding) {
        return axios({
            url: '/crm/selectTelCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },

    // 获取可回收客户
    findAssignApi(data, binding) {
        return axios({
            url: '/crm/findAssign',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },

    // 回收单条客户
    toAllocatedApi(data, binding) {
        return axios({
            url: 'crm/toAllocated',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // // 批量回收客户
    toAllocatedMoreApi2(data) {
        return axios({
            url: 'crm/numRecovery',
            method: 'post',
            data
        })
    },
    // 批量回收并分配客户
    toAllocatedMoreApi(data) {
        return axios({
            url: 'crm/recoveryAndRandom',
            method: 'post',
            data
        })
    },
    //恢复客户数据
    recoveryCustApi(data, binding) {
        return axios({
            url: '/crm/recoveryCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //恢复客户数据
    recoveryCustApi2(data, binding) {
        return axios({
            url: '/crm/recoveryCustomerList',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //恢复客户数据
    recoveryCustApi(data, binding) {
        return axios({
            url: '/crm/recoveryCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },


    // 获取未做计划客户
    findNoPlanApi(data, binding) {
        return axios({
            url: '/crm/findNoPlan',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 单个回退客户
    returnCustApi(data, binding) {
        return axios({
            url: '/crm/customerReturnForFlower',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 批量回退客户
    moreReturn_Api(data, binding) {
        return axios({
            url: '/crm/customerReturnList',
            method: 'post',
            data
        })
    },
    //获取可合并客户
    mergeCustApi(data, binding) {
        return axios({
            url: '/crm/selectMerge',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //合并客户
    mergeCustomerApi(data, binding) {
        return axios({
            url: '/crm/mergeCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },

    //接线部电话进入
    custPhoneApi(data, binding) {
        return axios({
            url: 'crm/selectCustomerForTel',
            method: 'get',
            params: data,
            headers: {
                "binding": binding
            }
        })
    },
    //接线部发短信
    sendEmailApi(data, binding) {
        return axios({
            url: '/crm/sendEmail',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 插入新客户到分配客户
    insertNewCustApi(data, binding) {
        return axios({
            url: '/crm/distributionInsert',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //获取手动分配客户列表
    getManualCustApi(data) {
        return axios({
            url: '/crm/distributionSelectByMyId',
            method: 'post',
            data
        })
    },
    // 自动分配
    autoAllocationApi(data, binding) {
        return axios({
            url: '/crm/getDistribution',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //接线部删除客户
    delCustApi(data, binding) {
        return axios({
            url: '/crm/distributionCustomer/deleteAllocated',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 回退客户列表
    getReturnListApi(data, binding) {
        return axios({
            url: '/crm/selectCustomerReturn',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    // 修改客户详情
    updateCustomerApi(data, binding) {
        return axios({
            url: '/crm/updateCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //新增房产
    addHouseApi(data, binding) {
        return axios({
            url: '/crm/insertHouse',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //修改房产
    upDateHouseApi(data, binding) {
        return axios({
            url: '/crm/updateHouse',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //删除房产
    delHouseApi(data, binding) {
        return axios({
            url: '/crm/deleteHouse',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //查询可领取客户
    searchNewCustApi(data, binding) {
        return axios({
            url: '/crm/receiveCustomer',
            method: 'post',
            data,
            headers: {
                "binding": binding
            }
        })
    },
    //领取客户
    getNewCustApi(data) {
        return axios({
            url: '/crm/receive',
            method: 'post',
            data
        })
    },
    // 详情电话
    getDetailTelApi(data) {
        return axios({
            url: '/crm/findTelMsg',
            method: 'post',
            data
        })
    },
    // 详情计划
    getDetailPlanApi(data) {
        return axios({
            url: '/crm/findPlan',
            method: 'post',
            data
        })
    },
    // 详情流转
    getDetailCirApi(data) {
        return axios({
            url: '/crm/findTransfer',
            method: 'post',
            data
        })
    },
    // 详情房产
    getDetailHouseApi(data) {
        return axios({
            url: '/crm/findHouse',
            method: 'post',
            data
        })
    },
    // 详情签单
    getDetailSignApi(data) {
        return axios({
            url: '/crm/findSign',
            method: 'post',
            data
        })
    },
    // 被计划人
    getCreatePeoApi(data) {
        return axios({
            url: '/crm/roleForPlan',
            method: 'get',
            params: data
        })
    },
    // 获取通话记录
    getTels(data) {
        return axios({
            url: '/crm/selectCallMes',
            method: 'post',
            data
        })
    },
    // 接线部二次上传
    callUpLoadSureApi(data) {
        return axios({
            url: '/crm/callDownload',
            method: 'post',
            data
        })
    },
    // 接线部上传分页
    changePageNumber(data) {
        return axios({
            url: '/crm/callPageUp',
            method: 'post',
            data
        })
    },
    // 接线部关闭上传框清楚缓存
    closeClearApi(data) {
        return axios({
            url: '/crm/deleteCallRedis',
            method: 'post',
            data
        });
    },
    // 信息部二次上传
    infoUpLoadSureApi(data) {
        return axios({
            url: '/crm/fileDownload',
            method: 'post',
            data
        })
    },
    // 信息部上传分页
    infoChangePage(data) {
        return axios({
            url: '/crm/filePageUp',
            method: 'post',
            data
        })
    },
    // 信息部关闭上传框清楚缓存
    infoCloseClearApi(data) {
        return axios({
            url: '/crm/deleteFileRedis',
            method: 'post',
            data
        });
    },
    // 最后联系时间修改 
    lastContactTimeApi(data) {
        return axios({
            url: '/crm/contact',
            method: 'post',
            data
        });
    },
    //  最后接通时间修改
    lastConnectTimeApi(data) {
        return axios({
            url: '/crm/connect',
            method: 'post',
            data
        });
    },
    // 回退类型
    returnTypeApi(data) {
        return axios({
            url: '/crm/returnRemarks',
            method: 'get',
            params: data
        });
    },
    // 按条数分配
    disbutionNum_Api(data) {
        return axios({
            url: '/crm/randomAllocation',
            method: 'post',
            data
        });
    },
    // 当前计划时间的计划数
    getPlanNum_Api(data) {
        return axios({
            url: '/crm/selectPlanForDay',
            method: 'get',
            params:data
        });
    },
    // 待分配客户列表继续分配
    moreDistribution_Api(data) {
        return axios({
            url: '/crm/randomAll',
            method: 'post',
            data
        });
    },
    // 接线部未接通客户分配
    disNotConnectCust_Api(data) {
        return axios({
            url: `/crm/telephoneDistribution?callInfoId=${data.callInfoId}&userId=${data.userId}`,
            method: 'post'
        });
    },
    // 电话2是否可修改
    tel2IsEidit(data){
        return axios({
            url: '/crm/tel2Status',
            method: 'get',
            params:data
        });
    }
};